//
//  vdDigit.h
//  Void Dead
//
//  Created by Sidney Just on 14.12.09.
//
//  Copyright © 2009 by Sidney Just
//  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
//  documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
//  the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 
//  and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
//  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
//  PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
//  FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
//  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

#import <Foundation/Foundation.h>

#import "vdLabel.h"

/**
 * This class represents a digit, an object that can be used to print the value of vars on the screen.
 * <br>The special thing about digits is, that if the value of the displayed var changes, the digit will also update itself and display the new value.
 * @remark As the digit uses pointer to get the actual value of the var, you can't use local vars from functions!
 **/
@interface vdDigit : vdLabel {
	@private
	int   *iDigit;
	int    iOld;
	
	float *fDigit;
	float  fOld;
	
	int mode;
	NSString *preString;
}

/**
 * Sets a new float var that should be displayed.
 @param val The new var
 **/
- (void)setFloatValue:(float *)val;

/**
 * Sets a int float var that should be displayed.
 @param val The new var
 **/
- (void)setIntValue:(int *)val;

/**
 * Sets the prestring of the digit. This string will be displayed before the value of the digit
 @param str The new pre string oder NULL
 **/
- (void)setPreString:(NSString *)str;

/**
 * Creates a digit with the given int value
 @param val The value that should be displayed
 @return Pointer to the new vdDigit
 **/
+ (vdDigit *)digitWithInt:(int *)val;

/**
 * Creates a digit with the given float value
 @param val The value that should be displayed
 @return Pointer to the new vdDigit
 **/
+ (vdDigit *)digitWithFloat:(float *)val;

@end
